package com.twu.biblioteca.model;

/**
 * Created by akutschm on 06/05/2014.
 */
public class Movie {

    private final int id;
    private final String title;
    private final String author;
    private final Integer rating;
    private final int year;
    private boolean reserved;

    public Movie(int id, String title, int year, String author, Integer rating) {
        this(id, title, year, author, rating, false);
    }

    public Movie(int id, String title, int year, String author, Integer rating, boolean reserved) {
        if (rating != null && (rating < 1 || rating > 10)) {
            throw new IllegalArgumentException();
        }
        this.id = id;
        this.title = title;
        this.year = year;
        this.author = author;
        this.rating = rating;
        this.reserved = reserved;
    }

    private void init(int id, String title, int year, String author, Integer rating, boolean reserved) {

    }

    public int getId() {
        return id;
    }

    public String getTitle() {
        return title;
    }

    public int getYear() {
        return year;
    }


    public String getAuthor() {
        return author;
    }

    public Integer getRating() {
        return rating;
    }


    public boolean isReserved() {
        return reserved;
    }

    public void setReserved(boolean reserved) {
        this.reserved = reserved;
    }
}
